<?php

namespace app\common\model;

use think\Model;

class User extends Model
{

    protected $table = 'qi_user';

    protected $autoWriteTimestamp = 'datetime';
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';



    public function getPageList($pagesize=10){
        $list = $this->order('id', 'desc')->paginate($pagesize);

        return $list;
    }


    public function addUser($info){

        $info['password'] = md5($info['password']);

        $this->data($info);

        $result = $this->save();


        return $result;
    }

    public function delUser($id){
        return $this->where('id',$id)->delete();
    }



}